package com.lzq.his.common;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;

/**
 * 封装分页请求参数
 * 并对分页参数 做 做参数校验（注解方法）
 */
public class PageReq {
    
    // 页码
    @NotNull(message = "【页码】不能为空")
    private int pageNum;
    
    // 页大小
    @NotNull(message = "【每页条数】不能为空")
    @Max(value = 1000, message = "【每页条数】不能超过1000")
    private int pageSize;

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    @Override
    public String toString() {
        return "PageReq{" +
                "pageNum=" + pageNum +
                ", pageSize=" + pageSize +
                '}';
    }
}
